feat: hide type inlay hints for initializations of closures#12263
Conversation
Veykril
left a comment
There was a problem hiding this comment.
Sounds good to me, I am still thinking about whether to remove the block expression limitation altogether. I only added it as I wasn't sure how helpful they'd be for non block expressions.
|
I would like to see |
|
☔ The latest upstream changes (presumably #12253) made this pull request unmergeable. Please resolve the merge conflicts. |
|
☔ The latest upstream changes (presumably #12320) made this pull request unmergeable. Please resolve the merge conflicts. |
|
Thanks! @bors r+ |
|
📌 Commit 2b1c1a9 has been approved by |
|
☀️ Test successful - checks-actions |
This PR adds an option to hide the inlay hints for
let IDENT_PAT = CLOSURE_EXPR;, which is a somewhat common coding pattern. Currently the inlay hints for the assigned variable and the closure expression itself are both displayed, making it rather repetitive.In order to be consistent with closure return type hints, only closures with block bodies will be hid by this option.
Personally I'd feel comfortable making it always enabled (or at least when closure return type hints are enabled), but considering the precedent set in #10761, I introduced an off-by-default option for this.
changelog feature: option to hide type inlay hints for
letstatements that initialize to a closure